package com.rocketmq.temp3.controller;

import com.rocketmq.temp3.common.shared.DataResult;
import com.rocketmq.temp3.service.bo.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProducerController {

    private OrderService orderService;

    @Autowired
    public ProducerController(OrderService orderService) {
        this.orderService = orderService;
    }

    /**
     * RocketMQ 事务消息 演示
     */
    @GetMapping(value = "/test")
    public DataResult<Integer> testBaseDao() {
        return orderService.saveOrder();
    }

}
